#define _CRT_SECURE_NO_WARNINGS 1
#include"SList.h"

void TestSList()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPushBack(&plist, 5);
	SLTPrint(plist);

	SLTPushFront(&plist, 10);
	SLTPushFront(&plist, 20);
	SLTPushFront(&plist, 30);
	SLTPushFront(&plist, 40);
	SLTPrint(plist);

	SLTPopFront(&plist);
	SLTPrint(plist);

	SLTPopBack(&plist);
	SLTPrint(plist);

	SLTNode* pos = SLTFind(plist, 2);
	if (pos)
	{
		pos->data *= 100;
	}
	SLTPrint(plist);

	pos = SLTFind(plist, 10);
	SLTInsert(&plist, pos, 39);
	SLTPrint(plist);

	SLTInsertAfter(pos, 56);
	SLTPrint(plist);

	pos = SLTFind(plist, 20);
	SLTErase(&plist, pos);
	SLTPrint(plist);

	pos = SLTFind(plist, 3);
	SLTEraseAfter(pos);
	SLTPrint(plist);

	SLTDestroy(&plist);
}

int  main()
{
	TestSList();
	return 0;
}